//
//  YDQuestionCellModel.m
//  PeiZiWangBei
//
//  Created by LK-IOS on 2017/11/13.
//  Copyright © 2017年 LK-IOS. All rights reserved.
//

#import "YDQuestionCellModel.h"


@implementation YDQuestionCellModel

-(CGFloat)cellH
{
    
    //左右间距
    CGFloat marginL = rate375(20);
    //上下间距
    CGFloat marginT;
    if (isPhoneX) {
        marginT = rateX812(12);
    }else{
        marginT = rate750(12);
    }
    
    //图片frame
    CGFloat imageX = marginL;
    CGFloat imageY = marginT;
    CGFloat imageWH = rate375(22);
    _imageFrame = CGRectMake(imageX, imageY, imageWH, imageWH);
    
    
    //标题的frame
    CGFloat titleW = rate375(300);
    CGFloat titleH = [NSString getWrapSpaceLabelHeight:self.detail withFont:[UIFont systemFontOfSize:font14ScreenWRate * LKScreenW] withWidth:titleW andWrapSpace:0.5 withSpace:1.0];
    
    _titleFrame = CGRectMake(rate375(45) + rate375(10), imageY, titleW, titleH);

    return CGRectGetMaxY(_titleFrame) + marginT;
}

-(NSAttributedString *)attrDetail
{
    return [NSString createLineWrapAttriStringWithString:self.detail andLineSpace:1.0 withWrapSpace:0.5 Font:[UIFont systemFontOfSize:font14ScreenWRate * LKScreenW]];
}
@end
